package cn.ismartv.indicatorscrollview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.Scroller;

/**
 * Created by huaijie on 3/4/16.
 */
public class IndicatorScrollView extends FrameLayout {
    private Scroller mScroller;

    public IndicatorScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mScroller = new Scroller(context);
    }

    public IndicatorScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mScroller = new Scroller(context);
    }

    public IndicatorScrollView(Context context) {
        super(context);
        mScroller = new Scroller(context);
    }

    public void showNext() {
        mScroller.startScroll(0, 0, 200, 0, 800);
        invalidate();
    }

    @Override
    public void scrollBy(int x, int y) {
        super.scrollBy(x, y);
    }

    @Override
    protected int computeHorizontalScrollRange() {
        return 3000;
    }

    @Override
    protected int computeHorizontalScrollOffset() {
        return 3000;
    }
}

